package com.liser.material.design.framework.observer;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;

/**
 * @author LISER
 * @date 2019/12/29 3:15
 */
public abstract class SimpleObserver<T> implements Observer<T> {

    @Override
    public void onSubscribe(Disposable d) {

    }

    @Override
    public void onNext(T t) {
        onSuccess(t);
    }

    @Override
    public void onError(Throwable e) {

    }

    @Override
    public void onComplete() {

    }

    /**
     * 成功处理
     *
     * @param t 订阅数据
     */
    public abstract void onSuccess(T t);
}
